# -*- coding:utf-8 -*-
"""
@file: load_logging_fle_configuration.py
@Description: 通过加载日志配置文件的方式配置日志信息
@author: Yu Wenjie
@email : yuwenjie@cetc-cloud.com
@version: 
@date: 2017/10/17 19:13
"""

from logging.config import fileConfig
import logging

try:
    fileConfig(r"E:/PyProject/python/basic_python/logging")
except Exception as e:
    print(str(e))

# create logger
logger_root = "root"
logger_info="infoLogger"
logger_error="errorLogger"
logger1 = logging.getLogger(logger_root)
logger2 = logging.getLogger(logger_info)
logger3 = logging.getLogger(logger_error)

# root
logger1.debug('debug message')
logger1.info('info message')
logger1.warn('warn message')
logger1.error('error message')
logger1.critical('critical message')

# info
logger2.debug('debug message')
logger2.info('info message')
logger2.warn('warn message')
logger2.error('error message')
logger2.critical('critical message')

# error
logger3.debug('debug message')
logger3.info('info message')
logger3.warn('warn message')
logger3.error('error message')
logger3.critical('critical message')
